﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BackGround : BasePanel
{
	CanvasGroup canvasGroup;
	private void Awake() {
		canvasGroup = GetComponent<CanvasGroup>();
		uipanelType = UIPanelType.BackGround;
	}

	public override void OnEnter() {
		canvasGroup.blocksRaycasts = true;
		canvasGroup.alpha = 1;
		transform.SetAsLastSibling();
		GetComponent<RectTransform>().localScale = Vector3.one;
	}

	public override void OnPause() {
		canvasGroup.blocksRaycasts = false;
	}

	public override void OnResume() {
		canvasGroup.blocksRaycasts = true;
	}

	public void OpenPanel(string pnl) {
		uiMng.PushStack((UIPanelType)System.Enum.Parse(typeof(UIPanelType), pnl));
	}

	public void OnClickMode() {
		uiMng.PushStack(UIPanelType.ModePanel);
	}

	public void OnClickMenu() {

	}

	public void OnClickBack() {
		uiMng.PushStack(UIPanelType.MenuPanel);
	}


}
